﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using ThouShaltNotBrick.Logic.GeneralObjects;
using GameUtils.Input;
using GameUtils.Events;
using ThouShaltNotBrick.Logic.Helpers;

namespace ThouShaltNotBrick.Logic.GameStates
{
    internal abstract class PlayGameStateBase : GameStateBase
    {
        #region Properties
        protected PlayData mPlayData;

        protected LevelDrawer mLevelDrawer;
        protected LevelUpdater mLevelUpdater;
        #endregion

        #region Overriden Methods
        protected override void InitializeImpl()
        {
            mClearColor = Color.Brown;

            mLevelDrawer = new LevelDrawer(mGraphics, mGraphicsResources, mFontResources, mGameManager.GetClientWidth(), mGameManager.GetClientHeight());
            mLevelUpdater = new LevelUpdater();
        }

        protected override void DestroyImpl()
        {
        }
        #endregion

        #region Methods
        protected void SetPlayData(GameStateChangeData pChangeData)
        {
            mPlayData = (PlayData)pChangeData.Data;
        }

        protected void ChangeToAnotherPlayState(GameStateType pGameStateType)
        {
            GameStateChangeData gscd = new GameStateChangeData(mPlayData);
            GameStateManager.ChangeState(pGameStateType, gscd);
        }
        #endregion
    }
}